import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/main'
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/Login.vue')
  },
  {
    path: '/main',
    name: 'Main',
    component: () => import('../views/Main.vue'),
    children :[
      {
        path: '/users',
        name: 'Users',
        component: () => import('../views/user/Users.vue'),
      },  {
        path: '/welcome',
        name: 'welcome',
        component: () => import('../views/welcome.vue'),
      },  {
        path: '/roles',
        name: 'Roles',
        component: () => import('../views/roles/Roles.vue'),
      },
      {
        path: '/salary',
        name: 'Salary',
        component: () => import('../views/salary/Salary.vue'),
      },
      {
        path: '/departments',
        name: 'Departments',
        component: () => import('../views/departments/Departments'),
      },
      {
        path: '/employees',
        name: 'Employees',
        component: () => import('../views/employees/Employees'),
      }
      ,
      {
        path: '/mood',
        name: 'Mood',
        component: () => import('../views/mood/Mood'),
      }
      ,
      {
        path: '/quit',
        name: 'Quit',
        component: () => import('../views/quit/Quit'),
      }
      ,
      {
        path: '/leave',
        name: 'Leave',
        component: () => import('../views/leave/Leave'),
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
